home *** CD-ROM | disk | FTP | other *** search
/ Canon Creative 3 / Canon Creative 3.iso / txtbrdge / Win31 / DISK1 / TXBRIDGE.MST < prev    next >
Encoding:
Text File  |  1997-01-10  |  16.9 KB  |  541 lines

  1. '**************************************************************************
  2. '*                       TextBridge 1.0 Microsoft Setup Script
  3. '**************************************************************************
  4.  
  5. ''$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. '' KLUDGE!  Took this really useful function from the debug ones, so
  11. '' I can validate a path!
  12.  
  13. DECLARE FUNCTION FValidFATDir LIB "mscomstf.dll" (szFile$) AS INTEGER  
  14.  
  15. ''Dialog ID's
  16. CONST WELCOME       = 100
  17. CONST LICENSE       = 110
  18. CONST ASKQUIT       = 200
  19. CONST DESTPATH      = 300
  20. CONST EXITFAILURE   = 400
  21. CONST EXITQUIT      = 600
  22. CONST EXITSUCCESS   = 700
  23. CONST OPTIONS       = 800
  24. CONST APPHELP       = 900
  25. CONST BADPATH       = 6400
  26. CONST DIREXISTS     = 1201
  27. CONST LANGHELP      = 1200
  28. CONST LANGPACKS     = 1100
  29. CONST NOLANGS             = 1300
  30. CONST NOSPACE             = 1400
  31. CONST DISKHELP            = 1600
  32.  
  33. ''Bitmap ID
  34. CONST LOGO = 1
  35.  
  36. GLOBAL DEST$        ''Default destination directory.
  37. GLOBAL SrcDir$            '' STF_SRCDIR.
  38. GLOBAL DEFLANG$          ''Default Language id
  39. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  40. DECLARE SUB AddNewVerSectionToCopyList (szSection$, szSrcDir$, szDstDir$)
  41. DECLARE SUB AddNewVerSectionKeyToCopyList (szSection$, szKey$, szSrcDir$, szDstDir$)
  42.  
  43.  
  44. INIT:
  45.     CUIDLL$ =  GetSymbolValue("STF_CWDDIR") + "mscuistf.dll"            ''Custom user interface dll
  46.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  47.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  48.     SetBitmap CUIDLL$, LOGO
  49.     SetTitle "TextBridge OCR Setup Utility"
  50.  
  51.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  52.     IF szInf$ = "" THEN
  53.     szInf$ = GetSymbolValue("STF_CWDDIR") + "TXBRIDGE.INF"
  54.     END IF
  55.     ReadInfFile szInf$
  56.  
  57.     DEST$ = "C:\TXBRIDGE"
  58.  
  59. '$IFDEF DEBUG
  60.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  61.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  62.     IF IsDriveValid(WinDrive$) = 0 THEN
  63.     i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  64.     GOTO QUIT
  65.     END IF
  66. '$ENDIF ''DEBUG
  67.  
  68.  
  69. WELCOME:
  70. ''
  71. '' Show the max window first!
  72. ''
  73.     a%=ShowWindow( HwndFrame, 3)
  74.  
  75.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  76.     IF sz$ = "CONTINUE" THEN
  77.     UIPop 1
  78.     ELSE
  79.     GOSUB ASKQUIT
  80.     GOTO WELCOME
  81.     END IF
  82.  
  83. LICENSE:
  84.     sz$ = UIStartDlg(CUIDLL$, LICENSE, "FInfoDlgProc", 0,"")
  85.     IF sz$ = "CONTINUE" THEN
  86.     UIPop 1
  87.     ELSE
  88.     UIPopAll
  89.     ERROR STFQUIT
  90.     END IF
  91.  
  92.  
  93.  
  94. GETPATH:
  95.     ClearCopyList
  96.     SetSymbolValue "EditTextIn", DEST$
  97.     SetSymbolValue "EditFocus", "END"
  98. GETPATHL1:
  99.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  100.     DEST$ = GetSymbolValue("EditTextOut")
  101.  
  102.     IF sz$ = "CONTINUE" THEN
  103. '*
  104. '* Make sure we have a valid path if we can.
  105. '*
  106.    IF FValidFATDir(DEST$) = 0 THEN
  107.     GOSUB BADPATH
  108.     UiPop 1
  109.     GOTO GETPATHL1
  110.     END IF
  111.  
  112.    IF DoesDirExist(DEST$) THEN
  113.     sz$ = UIStartDlg(CUIDLL$, DIREXISTS, "FQuitDlgProc", APPHELP, HELPPROC$)
  114.     IF sz$ = "EXIT" THEN
  115.            UIPop 1
  116.            GOTO GETPATHL1
  117.            END IF
  118.     UiPop 1
  119.     ELSE
  120.     CreateDir DEST$, cmoNone
  121.     IF IsDirWritable(DEST$) = 0 THEN
  122.         GOSUB BADPATH
  123.         UiPop 1
  124.         GOTO GETPATHL1
  125.        END IF
  126.     UIPop 1
  127.    END IF
  128.     
  129.     ELSEIF sz$ = "REACTIVATE" THEN
  130.     GOTO GETPATHL1
  131.     ELSEIF sz$ = "BACK" THEN
  132.     UIPop 1
  133.     GOTO INIT
  134.     ELSE
  135.     GOSUB ASKQUIT
  136.     UiPop 1
  137.     GOTO GETPATH
  138.     END IF
  139.  
  140. ''For good measure...
  141. UiPopAll
  142.  
  143. GETLANGS1:
  144. '' Here is where we should initialize the languages to default to English.
  145. LANGLST$ = ""
  146. DEFLANG$ = "0"
  147. GETLANGS:
  148.     sz$ = UIStartDlg(CUIDLL$, LANGPACKS, "FCheckDlgProc", LANGHELP, HELPPROC$)
  149.      IF sz$ = "CONTINUE" THEN 
  150.      szlang$ = GetListItem("CheckItemsOut", 1)
  151.      IF szlang$ = "ON" THEN
  152.         AddSectionKeyFileToCopyList "Langs", "1", SrcDir$, DEST$ + "\bin"
  153.         LANGLST$ = LANGLST$ + "English, "
  154.         DEFLANG$ = "1"
  155.         END IF
  156.      szlang$ = GetListItem("CheckItemsOut", 2)
  157.  
  158.  
  159.      IF szlang$ = "ON" THEN
  160.         AddSectionKeyFileToCopyList "Langs", "2", SrcDir$, DEST$ + "\bin"
  161.         LANGLST$ = LANGLST$ + "French, "
  162.         IF DEFLANG$ = "0" THEN
  163.             DEFLANG$ = "4"
  164.             END IF
  165.         END IF
  166.      szlang$ = GetListItem("CheckItemsOut", 3)
  167.  
  168.      IF szlang$ = "ON" THEN
  169.         AddSectionKeyFileToCopyList "Langs", "3", SrcDir$, DEST$ + "\bin"
  170.         LANGLST$ = LANGLST$ + "Italian, "
  171.         IF DEFLANG$ = "0" THEN
  172.             DEFLANG$ ="16"
  173.             END IF
  174.         END IF
  175.      szlang$ = GetListItem("CheckItemsOut", 4)
  176.  
  177.  
  178.      IF szlang$ = "ON" THEN
  179.         AddSectionKeyFileToCopyList "Langs", "4", SrcDir$, DEST$ + "\bin"
  180.         LANGLST$ = LANGLST$ + "German, "
  181.         IF DEFLANG$ = "0" THEN
  182.             DEFLANG$ = "2"
  183.             END IF
  184.         END IF
  185.      szlang$ = GetListItem ("CheckItemsOut", 5)
  186.  
  187.      IF szlang$ = "ON" THEN
  188.         AddSectionKeyFileToCopyList "Langs", "5", SrcDir$, DEST$ + "\bin"
  189.         LANGLST$ = LANGLST$ + "Spanish, "
  190.         IF DEFLANG$ = "0" THEN
  191.             DEFLANG$ = "8"
  192.             END IF
  193.         END IF
  194.      szlang$ = GetListItem ("CheckItemsOut", 6)
  195.  
  196.      IF szlang$ = "ON" THEN
  197.         AddSectionKeyFileToCopyList "Langs", "6", SrcDir$, DEST$ + "\bin"
  198.         LANGLST$ = LANGLST$ + "Portegese, "
  199.         IF DEFLANG$ = "0" THEN
  200.             DEFLANG$ = "1024"
  201.             END IF
  202.         END IF
  203.      szlang$ = GetListItem ("CheckItemsOut", 7)
  204.  
  205.      IF szlang$ = "ON" THEN
  206.         AddSectionKeyFileToCopyList "Langs", "7", SrcDir$, DEST$ + "\bin"
  207.         LANGLST$ = LANGLST$ + "Dutch, "
  208.         IF DEFLANG$ = "0" THEN
  209.             DEFLANG$ = "32"
  210.             END IF
  211.         END IF
  212.      szlang$ = GetListItem ("CheckItemsOut", 8)
  213.  
  214.      IF szlang$ = "ON" THEN
  215.         AddSectionKeyFileToCopyList "Langs", "8", SrcDir$, DEST$ + "\bin"
  216.         LANGLST$ = LANGLST$ + "Swedish, "
  217.         IF DEFLANG$ = "0" THEN
  218.             DEFLANG$ = "64"
  219.             END IF
  220.         END IF
  221.      szlang$ = GetListItem ("CheckItemsOut", 9)
  222.  
  223.      IF szlang$ = "ON" THEN
  224.         AddSectionKeyFileToCopyList "Langs", "9", SrcDir$, DEST$ + "\bin"
  225.         LANGLST$ = LANGLST$ + "Finnish, "
  226.         IF DEFLANG$ = "0" THEN
  227.             DEFLANG$ = "256"
  228.             END IF
  229.         END IF
  230.      szlang$ = GetListItem ("CheckItemsOut", 10)
  231.  
  232.      IF szlang$ = "ON" THEN
  233.         AddSectionKeyFileToCopyList "Langs", "10", SrcDir$, DEST$ + "\bin"
  234.         LANGLST$ = LANGLST$ + "Danish, "
  235.         IF DEFLANG$ = "0" THEN
  236.             DEFLANG$ = "512"
  237.             END IF
  238.         END IF
  239.      szlang$ = GetListItem ("CheckItemsOut", 11)
  240.  
  241.      IF szlang$ = "ON" THEN
  242.         AddSectionKeyFileToCopyList "Langs", "11", SrcDir$, DEST$ + "\bin"
  243.         LANGLST$ = LANGLST$ + "Norwegian, "
  244.         IF DEFLANG$ = "0" THEN
  245.             DEFLANG$ = "128"
  246.             END IF
  247.         END IF
  248.      IF LANGLST$ = "" THEN
  249.     sz$ = UIStartDlg(CUIDLL$, NOLANGS, "FEditDlgProc", LANGHELP, HELPPROC$)
  250.      UiPop 1
  251.      GOTO GETLANGS1
  252.      ENDIF
  253.      '' Here we handle the other buttons on the dialog:
  254.     UIPop 1
  255.     ELSEIF sz$ = "REACTIVATE" THEN
  256.     GOTO GETLANGS
  257.     ELSEIF sz$ = "BACK" THEN
  258.     UIPopAll
  259.     GOTO GETPATHL1
  260.     ELSE
  261.     GOSUB ASKQUIT
  262.     GOTO GETLANGS1
  263.     END IF
  264.  
  265. '' NOW DO THE INSTALL!!
  266. ''
  267.     GOSUB INSTALL
  268. ''
  269. ''
  270.  
  271.  
  272. QUIT:
  273. ''    ON ERROR GOTO ERRQUIT
  274.  
  275.     IF ERR = 0 THEN
  276.     dlg% = EXITSUCCESS
  277.     ELSEIF ERR = STFQUIT THEN
  278.     dlg% = EXITQUIT
  279.     ELSE
  280.     dlg% = EXITFAILURE
  281.     END IF
  282. QUITL1:
  283.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  284.     IF sz$ = "REACTIVATE" THEN
  285.     GOTO QUITL1
  286.     END IF
  287.     UIPop 1
  288.  
  289.     END
  290.  
  291. ERRQUIT:
  292.     i% = DoMsgBox("Sources were corrupted.  Please contact XIS Customer Support for assistance.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  293.     END
  294.  
  295.  
  296.  
  297. BADPATH:
  298.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  299.     IF sz$ = "REACTIVATE" THEN
  300.     GOTO BADPATH
  301.     END IF
  302.     UIPop 1
  303.     RETURN
  304.  
  305. ASKQUIT:
  306.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  307.  
  308.     IF sz$ = "EXIT" THEN
  309.     UIPopAll
  310.     ERROR STFQUIT
  311.     ELSEIF sz$ = "REACTIVATE" THEN
  312.     GOTO ASKQUIT
  313.     ELSE
  314.     UIPop 1
  315.     END IF
  316.     RETURN
  317.  
  318. CHKSPACE:
  319.     txspace& = GetCopyListCost("","","")
  320.     IF txspace& = 0 THEN
  321.         RETURN
  322.    ELSE
  323.         dspace& = GetFreeSpaceForDrive(DEST$)
  324.  
  325.         AddListItem "DriveStatusText", DEST$
  326.         AddListItem "DriveStatusText", STR$(txspace&)
  327.         AddListItem "DriveStatusText", STR$(dspace&)
  328.  
  329.     sz$ = UIStartDlg(CUIDLL$, NOSPACE, "FCustInstDlgProc", DISKHELP, HELPPROC$) 
  330.      IF sz$ = "EXIT" THEN
  331.         GOSUB ASKQUIT
  332.      ELSE
  333.            UiPop 1
  334.            GOTO GETPATH
  335.      ENDIF
  336.  ENDIF
  337. RETURN
  338.  
  339. '**
  340. '** Purpose:
  341. '**     Builds the copy list and performs all installation operations.
  342. '** Arguments:
  343. '**     none.
  344. '** Returns:
  345. '**     none.
  346. '*************************************************************************
  347. INSTALL:
  348.  
  349.  
  350.     CreateDir DEST$, cmoNone
  351.     CreateDir DEST$ + "\bin", cmoNone
  352. ''    CreateDir DEST$ + "\datacopy", cmoNone
  353. ''    CreateDir DEST$ + "\drivers", cmoNone
  354. ''    CreateDir DEST$ + "\ddemacs", cmoNone
  355.  
  356.     OpenLogFile MakePath(DEST$, "TXBRIDGE.LOG"), 0
  357.     WriteToLogFile ""
  358.     WriteToLogFile "  User chose as destination directory: '" + DEST$ + "'"
  359.     WriteToLogFile ""
  360.     WriteToLogFile "May have had to create the directory: " + DEST$
  361.     WriteToLogFile ""
  362.      WriteToLogFile "Languages Selected are: " + LANGLST$
  363.  
  364.     AddSectionFilesToCopyList "Files", SrcDir$, DEST$ + "\bin"
  365.     windir$ = GetWindowsDir()
  366.     tmp$ = MakePath(windir$,"pixtran") 
  367.     AddNewVerSectionToCopyList "Scanner", SrcDir$, tmp$
  368.     tmp$ = MakePath(windir$,"system") 
  369.     AddNewVerSectionToCopyList "Windows Sys", SrcDir$, tmp$
  370. ''    AddSectionFilesToCopyList "DDEMACS", SrcDir$, DEST$ + "\ddemacs"
  371.     AddSectionFilesToCopyList "DOC", SrcDir$, DEST$
  372. ''
  373. '' Add the datacopy files to the copylist.
  374. ''
  375. ''    AddSectionFilesToCopyList "DATACOPY", SrcDir$, DEST$ + "\datacopy"
  376. ''
  377. '' Before doing the install, lets see if they have the space to do it.
  378.      GOSUB CHKSPACE
  379.  
  380.     CopyFilesInCopyList
  381.  
  382. '' Now, delete their .ini file if it exists.
  383.     windir$ = GetWindowsDir()
  384.     ini$ = MakePath(windir$,"TXBRIDGE.INI") 
  385.     IF DoesFileExist(ini$, femExists) = 1 THEN
  386.     RemoveFile ini$, cmoNone
  387.     END IF
  388. '' Make the new .ini file, and put in the new root value for the    
  389. '' DDE stuff, and set a default language.
  390.      CreateIniKeyValue ini$, "txbridge", "scanner type", "TWAIN", cmOverwrite
  391.      CreateIniKeyValue ini$, "txbridge", "intl", "1", cmOverwrite
  392.      CreateIniKeyValue ini$, "txbridge", "memory", "native", cmOverwrite
  393.      CreateIniKeyValue ini$, "txbridge", "TWAINUI", "ON", cmOverwrite
  394.      CreateIniKeyValue ini$, "txbridge", "INVERT", "2", cmOverwrite
  395.      CreateIniKeyValue ini$, "txbridge", "cmdLine", "1", cmOverwrite
  396.     CreateIniKeyValue ini$, "txbridge", "ADF", "Off", cmoOverwrite
  397.     CreateIniKeyValue ini$, "txbridge", "root", DEST$, cmoOverwrite
  398.     CreateIniKeyValue ini$, "txbridge", "Language", DEFLANG$, cmOverwrite
  399.     CreateIniKeyValue ini$, "txbridge", "File", "File", cmOverwrite
  400.      CreateIniKeyValue ini$, "txbridge", "Edit", "Edit", cmOverwrite
  401.      CreateIniKeyValue ini$, "txbridge", "Paste", "Paste", cmOverwrite
  402.      CreateIniKeyValue ini$, "txbridge", "Exit", "Exit", cmOverwrite
  403.     CreateProgmanGroup "TextBridge OCR", "", cmoNone
  404.     CreateProgmanItem "TextBridge OCR", "TextBridge", DEST$ + "\bin\" + "txbridge.exe", "", cmoOverwrite
  405.     CreateProgmanItem "TextBridge OCR", "Scanner Setup", DEST$ + "\bin\" + "setscan.exe", "", cmoOverwrite
  406.     CreateProgmanItem "TextBridge OCR", "Release Notes", DEST$ + "\" + "relnote.wri","", cmoOverwrite
  407.     CreateProgmanItem "TextBridge OCR", "TextBridge Application Server", DEST$ + "\bin\" + "tbmenu.exe","",cmoOverwrite
  408.     CreateProgmanItem "TextBridge OCR", "TextBridge Pro -- How to Upgrade", DEST$ + "\bin\" + "upmenu16.hlp","", cmoOverwrite
  409.     ShowProgmanGroup  "TextBridge OCR", 1, cmoNone                                  
  410.     
  411.     CloseLogFile
  412.  RETURN
  413.  
  414.     
  415. '**
  416. '** Purpose:
  417. '**     Appends a file name to the end of a directory path,
  418. '**     inserting a backslash character as needed.
  419. '** Arguments:
  420. '**     szDir$  - full directory path (with optional ending "\")
  421. '**     szFile$ - filename to append to directory
  422. '** Returns:
  423. '**     Resulting fully qualified path name.
  424. '*************************************************************************
  425. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  426.     IF szDir$ = "" THEN
  427.     MakePath = szFile$
  428.     ELSEIF szFile$ = "" THEN
  429.     MakePath = szDir$
  430.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  431.     MakePath = szDir$ + szFile$
  432.     ELSE
  433.     MakePath = szDir$ + "\" + szFile$
  434.     END IF
  435. END FUNCTION
  436.  
  437. SUB AddNewVerSectionToCopyList (szSection$, szSrcDir$, szDstDir$) STATIC
  438.  
  439.     MakeListFromSectionKeys "VersionList", szSection$
  440.     iVerListLen% = GetListLength("VersionList")
  441.      
  442.     FOR i% = 1 TO iVerListLen% STEP 1
  443.         key$ = GetListItem("VersionList", i%)
  444.         IF key$ = "" THEN
  445.             rtn% = DoMsgBox("There is an error in the {" + szSection$ + "} section.  You must set REFKEY equal to the filename.ext", "Layout ERROR", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  446.             RETURN
  447.         END IF
  448.         
  449.         AddNewVerSectionKeyToCopyList szSection$, key$, szSrcDir$, szDstDir$
  450.     NEXT i%
  451.  
  452. END SUB
  453.  
  454.  
  455. SUB AddNewVerSectionKeyToCopyList (szSection$, szKey$, szSrcDir$, szDstDir$) STATIC
  456.  
  457.     IF szKey$ = "" THEN 
  458.         rtn% = DoMsgBox("szKey$ should not be equal to NULL", "Error in AddNewVerSectionKeyToCopyList", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  459.         RETURN
  460.     END IF
  461.     IF szSection$ = "" THEN 
  462.         rtn% = DoMsgBox("szSection$ should not be equal to NULL", "Error in AddNewVerSectionKeyToCopyList", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  463.         RETURN
  464.     END IF
  465.     IF szSrcDir$ = "" THEN 
  466.         rtn% = DoMsgBox("szSrcDir$ should not be equal to NULL", "Error in AddNewVerSectionKeyToCopyList", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  467.         RETURN
  468.     END IF
  469.     IF szDstDir$ = "" THEN 
  470.         rtn% = DoMsgBox("szDstDir$ should not be equal to NULL", "Error in AddNewVerSectionKeyToCopyList", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  471.         RETURN
  472.     END IF
  473.  
  474.  
  475.  
  476.     fileName$ = GetSectionKeyFilename(szSection$, szKey$)
  477.     sysFileName$ = MakePath(szDstDir$, fileName$)
  478.     ourVer$ = GetSectionKeyVersion(szSection$, szKey$)
  479.  
  480.  
  481.  
  482.     IF ourVer$ = "" THEN
  483.     ''''''''''''''''''''''''''''''''''''''
  484.     '' Use File dates to check versions ''
  485.     ''''''''''''''''''''''''''''''''''''''
  486.         ourDate$ = GetSectionKeyDate(szSection$, szKey$)
  487.         sysDate$ = GetDateOfFile (sysFileName$)
  488. '$IFDEF DEBUG
  489.         rtn% = DoMsgBox("Our file ("+sysFileName$+") has date " + ourDate$ + " and the system has date " + sysDate$, "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  490. '$ENDIF ''DEBUG
  491.         
  492.         IF GetYearFromDate(sysDate$) < GetYearFromDate(ourDate$) THEN
  493. '$IFDEF DEBUG
  494.             rtn% = DoMsgBox("Adding ("+fileName$+") to hard disk ", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  495. '$ENDIF ''DEBUG
  496.             AddSectionKeyFileToCopyList szSection$, szKey$, szSrcDir$, szDstDir$
  497.         ELSEIF GetYearFromDate(sysDate$) = GetYearFromDate(ourDate$) THEN
  498.             IF GetMonthFromDate(sysDate$) < GetMonthFromDate(ourDate$) THEN
  499. '$IFDEF DEBUG
  500.                 rtn% = DoMsgBox("Adding ("+fileName$+") to hard disk ", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  501. '$ENDIF ''DEBUG
  502.                 AddSectionKeyFileToCopyList szSection$, szKey$, szSrcDir$, szDstDir$
  503.             ELSEIF GetMonthFromDate(sysDate$) = GetMonthFromDate(ourDate$) THEN
  504.                 IF GetDayFromDate(sysDate$) < GetDayFromDate(ourDate$) THEN
  505. '$IFDEF DEBUG
  506.                     rtn% = DoMsgBox("Adding ("+fileName$+") to hard disk ", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  507. '$ENDIF ''DEBUG
  508.                     AddSectionKeyFileToCopyList szSection$, szKey$, szSrcDir$, szDstDir$
  509.                 END IF
  510.             END IF
  511.         END IF
  512.  
  513.  
  514.     ELSE
  515.     '''''''''''''''''''''''''''''''''''''''''''''''
  516.     '' Use Version information to check versions ''
  517.     '''''''''''''''''''''''''''''''''''''''''''''''
  518.         sysVer$ = GetVersionOfFile (sysFileName$)
  519.         IF sysVer$ <> ourVer$ THEN
  520. '$IFDEF DEBUG
  521.             rtn% = DoMsgBox("Our file ("+fileName$+") has version " + ourVer$ + " and the system has version " + sysVer$, "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  522. '$ENDIF ''DEBUG
  523.             IF GetVersionNthField(sysVer$, 1) < GetVersionNthField(ourVer$, 1) THEN
  524.                 AddSectionKeyFileToCopyList szSection$, szKey$, szSrcDir$, szDstDir$
  525.             ELSEIF GetVersionNthField(sysVer$, 1) = GetVersionNthField(ourVer$, 1) THEN
  526.                 IF GetVersionNthField(sysVer$, 2) < GetVersionNthField(ourVer$, 2) THEN
  527.                     AddSectionKeyFileToCopyList szSection$, szKey$, szSrcDir$, szDstDir$
  528.                 ELSEIF GetVersionNthField(sysVer$, 2) = GetVersionNthField(ourVer$, 2) THEN
  529.                     IF GetVersionNthField(sysVer$, 3) < GetVersionNthField(ourVer$, 3) THEN
  530.                         AddSectionKeyFileToCopyList szSection$, szKey$, szSrcDir$, szDstDir$
  531.                     ELSEIF GetVersionNthField(sysVer$, 3) = GetVersionNthField(ourVer$, 3) THEN
  532.                         IF GetVersionNthField(sysVer$, 4) < GetVersionNthField(ourVer$, 4) THEN
  533.                             AddSectionKeyFileToCopyList szSection$, szKey$, szSrcDir$, szDstDir$
  534.                         END IF
  535.                     END IF
  536.                 END IF
  537.             END IF
  538.         END IF
  539.     END IF
  540. END SUB
  541.